<script setup>
import { ref } from 'vue';
// 模拟购物车数据
const cartData = ref([
  {
    id: "4000277",
    skuId: "300283142",
    name: "玉米生长调节剂控旺 玉米控旺专用",
    attrsText: "一袋25克，一瓶400ml ",
    specs: [],
    picture: "../../static/images/pesticide2.webp",
    price: "79.00",
    nowPrice: "79.00",
    nowOriginalPrice: "79.00",
    selected: true,
    stock: 4654,
    count: 9,
    isEffective: true,
    discount: null,
    isCollect: false,
    postFee: 9,
  },
  {
    id: "4000252",
    skuId: "300283141",
    name: "玉米田除草剂（专用杀虫）",
    attrsText: "2瓶装（一瓶300ml）",
    specs: [],
    picture: "../../static/images/pesticide6.jpg",
    price: "88.00",
    nowPrice: "79.00",
    nowOriginalPrice: "79.00",
    selected: false,
    stock: 4654,
    count: 9,
    isEffective: true,
    discount: null,
    isCollect: false,
    postFee: 9,
  },
  {
    id: "4000290",
    skuId: "300283149",
    name: "24%烟密.秀去津（玉米苗后除草剂）",
    attrsText: "3瓶（一瓶400ml） ",
    specs: [],
    picture: "../../static/images/pesticide5.jpg",
    price: "66.00",
    nowPrice: "79.00",
    nowOriginalPrice: "79.00",
    selected: true,
    stock: 4654,
    count: 9,
    isEffective: true,
    discount: null,
    isCollect: false,
    postFee: 9,
  },
]);
const isChecked = ref(false)
const onChangeFn = (item) => {
  console.log(item);
  item.selected = !item.selected
}
</script>
<template>
  <view>
    <label class="radio" v-for="item in cartData"><radio value="r1" @tap="onChangeFn(item)" :checked="item.selected" />选中</label>
    
  </view>
</template>
<style lang="scss"></style>
